import {mapGetters} from 'vuex';

let colorMap = new Map();
colorMap.set('极低风险', '#52c41a');
colorMap.set('低风险', '#409EFF');
colorMap.set('中等风险', '#ffec3d');
colorMap.set('高风险', '#fa8c16');
colorMap.set('极高风险', '#820014');

let deviceNameMap=new Map();

deviceNameMap.set(1, '1号包装机');
deviceNameMap.set(2, '2号包装机');
deviceNameMap.set(3, '2号分拣线');
deviceNameMap.set(4, '1号分拣线');
deviceNameMap.set(5, '3号包装机');
deviceNameMap.set(6, '4号包装机');
deviceNameMap.set(7, '异型烟分拣机');
deviceNameMap.set(8, '4号分拣线');
deviceNameMap.set(9, '3号分拣线');
deviceNameMap.set(10, '前门水泵1');
deviceNameMap.set(11, '前门水泵2');
deviceNameMap.set(12, '前门模块机1');
deviceNameMap.set(13, '前门模块机2');
deviceNameMap.set(14, '前门模块机3');
deviceNameMap.set(15, '前门模块机4');
deviceNameMap.set(16, '前门模块机5');
deviceNameMap.set(17, '前门模块机6');
deviceNameMap.set(18, '前门模块机7');
deviceNameMap.set(19, '前门模块机8');
deviceNameMap.set(20, '前门模块机9');
deviceNameMap.set(21, '前门模块机10');
deviceNameMap.set(22, '前门模块机11');
deviceNameMap.set(23, '前门模块机12');
deviceNameMap.set(24, '后门水泵1');
deviceNameMap.set(25, '后门水泵2');
deviceNameMap.set(26, '后门模块机1');
deviceNameMap.set(27, '后门模块机2');
deviceNameMap.set(28, '后门模块机3');
deviceNameMap.set(29, '后门模块机4');
deviceNameMap.set(30, '后门模块机5');
deviceNameMap.set(31, '后门模块机6');
deviceNameMap.set(32, '昆船主控');
deviceNameMap.set(33, '机器手臂1');
deviceNameMap.set(34, '机器手臂2');
deviceNameMap.set(35, '堆垛机1');
deviceNameMap.set(36, '堆垛机2');
deviceNameMap.set(37, '堆垛机3');
deviceNameMap.set(38, '堆垛机4');
deviceNameMap.set(39, '空压机1');
deviceNameMap.set(40, '空压机2');
deviceNameMap.set(41, '一楼高压变电室');
deviceNameMap.set(42, 'C类烟库1');
deviceNameMap.set(43, 'C类烟库2');
deviceNameMap.set(44, 'UPS电源室（二楼）');
deviceNameMap.set(45, '二楼低压配电室1');
deviceNameMap.set(46, '二楼低压配电室2');
deviceNameMap.set(47, '地下一层高压配电室1');
deviceNameMap.set(48, '地下一层高压配电室2');
deviceNameMap.set(49, '地下一层水泵房');
deviceNameMap.set(50, '待分区环境监测1');
deviceNameMap.set(51, '待分区环境监测2');
deviceNameMap.set(52, '待分区环境监测3');
deviceNameMap.set(53, '1号堆垛机旁环境监测');
deviceNameMap.set(54, '1号堆垛机旁环境监测');
deviceNameMap.set(55, '4号堆垛机旁环境监测');
deviceNameMap.set(56, '4号堆垛机旁环境监测');
deviceNameMap.set(57, '高架库前门环境监测');
deviceNameMap.set(58, '叉车充电间');


let riskPositionMap = new Map();
export default {
    data: function () {
        return {
            timer: "",
            timerCount: 0,
            activeName: 'first',
            first_select_radio: '1',
            typeSwitch: 'cqec',
            basementHomeImg: require('../../assets/img/basementHome.jpg'),
            firstHome: require('../../assets/img/firstHome.jpeg'),
            gjkImg: require('../../assets/img/gjk.jpeg'),
            jyywyfImg: require('../../assets/img/jyywyf.jpeg'),
            cqecImg: require('../../assets/img/cqec.jpg'),
            crkqImg: require('../../assets/img/crkq.jpg'),
            fjqImg: require('../../assets/img/fjq.jpg'),
            syImg: require('../../assets/img/sy.jpg'),
            circleMarkData: [],
            filters: {
                biaoqian: '',
                zhuangtai: '',
                startNow: 0,
                endNow: 0
            },
            sels: [],
            addForm: {},
            addFormVisible: false,
            //编辑界面数据
            editForm: {},
            editFormVisible: false,
        }
    },
    created() {
    },
    mounted() {
        this.$store.dispatch('getRiskPositionListOptionsReturn', {page: 0, rows: 100}).then((res) => {
            res.forEach(item => {

                riskPositionMap.set(item.id, item.riskArea)
            });
            this.handleActiveClick('first');
        });

    },
    methods: {
        firstSelectOpt: function (value) {
            if (this.first_select_radio == '1') {

                this.clearTimer();
                this.circleMarkData = [];
                this.handleSearch({positionIds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 32, 33, 34, 39, 40, 41, 42, 43, 50, 51, 52,58]});
            } else if (this.first_select_radio == '2') {
                this.circleMarkData = [];
                this.clearTimer();
                this.handleSearch({positionIds: [32, 33, 34]});
            } else if (this.first_select_radio == '3') {
                this.circleMarkData = [];
                this.clearTimer();
                this.handleSearch({positionIds: [1, 2, 3, 4, 5, 6, 7, 8, 9, 39, 40, 41, 42, 43, 50, 51, 52]});
            } else if (this.first_select_radio == '4') {
                this.circleMarkData = [];
                this.clearTimer();
                this.handleSearch({positionIds: [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 35, 36, 37, 38, 39, 40, 41, 53, 54, 55, 56,57]});
            }
        },
        handleActiveClick: function (value) {
            this.activeName = value;
            if (this.activeName == 'first') {
                this.firstSelectOpt();
            } else if (this.activeName == 'second') {
                this.circleMarkData = [];
                this.clearTimer();
                this.handleSearch({positionIds: [44, 45, 46]});
            } else if (this.activeName == 'basement') {
                this.circleMarkData = [];
                this.clearTimer();
                this.handleSearch({positionIds: [47, 48, 49]});
            }
        },
        getRiskMeterData: function (positionIds) {
            this.$store.dispatch('getRiskMeterList', positionIds).then((res) => {
                this.circleMarkData = [];
                res.forEach(item => {
                    if(item.riskGrade=='安全'){
                        item.riskGrade='极低风险';
                    }
                    let circleMarkObj = {};
                    if (item.positionId > 49 && item.positionId < 58) {
                        circleMarkObj = {
                            id: item.positionId,
                            riskType: item.positionId,
                            score: item.score,
                            riskPositionName:riskPositionMap.get(item.positionId),
                            content: ['温度:' + item.t+' ℃','湿度:' + item.h+' %',  '氧气浓度:' + item.o+' %', '位置:' + riskPositionMap.get(item.positionId)],
                            title: deviceNameMap.get(item.positionId)
                        };
                    } else {
                        circleMarkObj = {
                            id: item.positionId,
                            riskType: item.positionId,
                            score: item.score,
                            riskPositionName:riskPositionMap.get(item.positionId),
                            content: ['危险等级:' + item.riskGrade,'电压:' + item.u+' V','电流:' + item.i+' A', '温度:' + item.t+' ℃','湿度:' + item.h+' %','氧气浓度:' + item.o+' %','分数:' + Math.floor(item.score * 100) / 100,  '位置:' + riskPositionMap.get(item.positionId)],
                            title:  deviceNameMap.get(item.positionId)
                        };
                    }
                    if (item.positionId == 1) {

                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '321px',
                                right: ' 233px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '354px',
                                right: '553px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 2) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '321px',
                                right: ' 312px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '307px',
                                right: '632px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 3) {

                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '270px',
                                right: ' 327px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '251px',
                                left: '653px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 4) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '260px',
                                right: ' 273px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '298px',
                                right: '387px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 5) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '324px',
                                right: '400px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '251px',
                                left: '390px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 6) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '327px',
                                right: ' 483px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '196px',
                                left: '289px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 7) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '266px',
                                right: ' 523px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '151px',
                                left: '497px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 8) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '259px',
                                right: '462px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '189px',
                                left: '557px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 9) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '265px',
                                right: '409px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '222px',
                                right: '488px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 10) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '100px',
                            left: '105px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 11) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '100px',
                            left: '165px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 12) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '135px',
                            left: '203px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 13) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '73px',
                            left: '229px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 14) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '135px',
                            left: '253px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 15) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '73px',
                            left: '277px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 16) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '135px',
                            left: '302px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 17) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '73px',
                            left: '326px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 18) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '135px',
                            left: '353px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 19) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '73px',
                            left: '376px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 20) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '135px',
                            left: '402px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 21) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '73px',
                            left: '423px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 22) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '135px',
                            left: '450px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 23) {

                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '73px',
                            left: '473px'
                        };
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 24) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '102px',
                            right: '279px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 25) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '102px',
                            right: '219px'
                        };
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 26) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '73px',
                            right: '182px'
                        };
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 27) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '135px',
                            right: '156px'
                        };
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 28) {

                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '73px',
                            right: '131px'
                        };
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 29) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '135px',
                            right: '108px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 30) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '73px',
                            right: '83px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 31) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '135px',
                            right: '60px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 32) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '120px',
                                left: ' 390px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '16px',
                                left: '685px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 33) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '120px',
                                left: ' 220px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '51px',
                                left: '484px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 34) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '120px',
                                left: '294px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '37px',
                                left: '587px'
                            };
                        }
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 35) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '266px',
                            right: '167px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 36) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '233px',
                            right: '167px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 37) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '201px',
                            right: '167px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 38) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '170px',
                            right: '167px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 39) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '196px',
                                right: '127px'
                            };
                        } else if (this.first_select_radio == '3') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '376px',
                                right: '99px'
                            };
                        } else if (this.first_select_radio == '4') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '100px',
                                left: '119px'
                            };
                        }

                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 40) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '200px',
                                right: '164px'
                            };
                        } else if (this.first_select_radio == '3') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '354px',
                                right: '129px'
                            };
                        } else if (this.first_select_radio == '4') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '100px',
                                left: '180px'
                            };
                        }

                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 41) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '160px',
                                right: '164px'
                            };
                        } else if (this.first_select_radio == '3') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '343px',
                                right: '31px'
                            };
                        } else if (this.first_select_radio == '4') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '126px',
                                left: '153px'
                            };
                        }

                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 42) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '392px',
                                right: '526px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '144px',
                                left: '95px'
                            };
                        }

                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 43) {
                        if (this.first_select_radio == '1') {

                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '353px',
                                right: '542px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '133px',
                                left: '153px'
                            };
                        }

                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 58) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '154px',
                            left: '18px'
                        };
                        this.circleMarkData.push(circleMarkObj);

                    }  else if (item.positionId == 44) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '295px',
                            left: '320px'
                        };
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 45) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '399px',
                            right: '305px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 46) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '391px',
                            right: '180px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 47) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '131px',
                            right: '236px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 48) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '163px',
                            right: '165px'
                        };
                        this.circleMarkData.push(circleMarkObj);

                    } else if (item.positionId == 49) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '84px',
                            right: '343px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 50) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '172px',
                                right: '310px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '270px',
                                right: '146px'
                            };
                        }

                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 51) {
                        console.log(item)
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '172px',
                                right: '463px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '172px',
                                right: '291px'
                            };
                        }

                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 52) {
                        if (this.first_select_radio == '1') {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '172px',
                                right: '600px'
                            };
                        } else {
                            circleMarkObj.style = {
                                background: colorMap.get(item.riskGrade),
                                top: '82px',
                                right: '449px'
                            };
                        }

                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 53) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '250px',
                            right: '449px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 54) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '250px',
                            left: '274px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 55) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '342px',
                            left: '274px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 56) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            bottom: '164px',
                            right: '584px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    } else if (item.positionId == 57) {
                        circleMarkObj.style = {
                            background: colorMap.get(item.riskGrade),
                            top: '269px',
                            left: '80px'
                        };
                        this.circleMarkData.push(circleMarkObj);
                    }

                })
            });
        },
        handleSearch: function (positionIds) {
            var _this = this; //声明一个变量指向Vue实例this，保证作用域一致
            this.getRiskMeterData(positionIds);
            this.timer = setInterval(function () {
                _this.getRiskMeterData(positionIds);
            }, 2000);

        },
        gotoRishTrendList: function (row) {

            var day2 = new Date();
            day2.setTime(day2.getTime());
            var day = day2.getFullYear() + "-" + (day2.getMonth() + 1) + "-" + day2.getDate();
            this.$router.push({
                path: '/rishTrendReportList',
                query: {
                    riskPositionName:row.riskPositionName,
                    riskType: row.riskType,
                    score: row.score,
                    positionId: row.id,
                    dimension: 'day',
                    day: day
                }
            })

        },
        clearTimer: function () {
            if (this.timer) {
                clearInterval(this.timer);
            }
        }
    },
    beforeDestroy() {
        if (this.timer) {
            clearInterval(this.timer);
        }
    }
}
